import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class Map {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        HashMap<String, String> a=new HashMap<>();
//        List b1=new List("cat","猫");
//        List b2=new List("dog","狗");
//        List b3=new List("man","人");
        a.put("dog","狗");
        a.put("cat","猫");
        a.put("man","人");
        System.out.println(a);
//        for (java.util.Map.Entry<String, List> stringStringEntry : a.entrySet()) {
//            System.out.println(stringStringEntry + " ");
//        }
        for(Object key:a.keySet()){
            String value= a.get(key);
            System.out.println(key+":"+value);
        }
        System.out.println("*********************");
        ArrayList<String> list1=new ArrayList<>();
        ArrayList list2=new ArrayList();
        ArrayList list3=new ArrayList();
        for(Object key:a.keySet()){
            String obj = a.get(key);
//            System.out.println(obj);
            System.out.println("请输入需要匹配的英文单词：");
            String b=in.next();
            if(a.containsKey(b))
            {   if(b.equals(a.values()))
                System.out.println("英文："+a.get(key));
                else if(b.equals(a.get(key)))
                    System.out.println("中文："+a.values());
            }
            else
                System.out.println("输入错误。");
//                list1.add(obj);
//            }
//            else if(b.contains("dog"))
//            {
//                System.out.println("狗");
//                list1.add(obj);
//            }
//            else if(b.contains("man"))
//            {
//                System.out.println("人");
//                list1.add(obj);
//            }
//            else
//                System.out.println("不存在。");
        }
    }
}
